<?php

class Application_Model_Utilisateur
{
	protected $_login;
	protected $_mdp;
	protected $_salt;
	protected $_nom;
	protected $_prenom;
	protected $_adresse;
	protected $_cp;
	protected $_ville;
	protected $_telephone;
	protected $_email;
	protected $_note;
	protected $_id;
	
	public function __construct(array $options = null)
	{
		if (is_array($options)) {
			$this->setOptions($options);
		}
	}
	
	public function __set($name, $value)
	{
		$method = 'set' . $name;
		if (('mapper' == $name) || !method_exists($this, $method)) {
			throw new Exception('Invalid user property');
		}
		$this->$method($value);
	}
	
	public function __get($name)
	{
		$method = 'get' . $name;
		if (('mapper' == $name) || !method_exists($this, $method)) {
			throw new Exception('Invalid user property');
		}
		return $this->$method();
	}
	
	public function setOptions(array $options)
	{
		$methods = get_class_methods($this);
		foreach ($options as $key => $value) {
			$method = 'set' . ucfirst($key);
			if (in_array($method, $methods)) {
				$this->$method($value);
			}
		}
		return $this;
	}
	
	public function setLogin($text)
	{
		$this->_login = $text;
		return $this;
	}
	
	public function getLogin()
	{
		return $this->_login;
	}
	
	public function setNom($text)
	{
		$this->_nom = (string) $text;
		return $this;
	}
	
	public function getNom()
	{
		return $this->_nom;
	}
	
	public function setEmail($email)
	{
		$this->_email = (string) $email;
		return $this;
	}
	
	public function getEmail()
	{
		return $this->_email;
	}
	
	public function setPrenom($ts)
	{
		$this->_prenom = $ts;
		return $this;
	}
	
	public function getPrenom()
	{
		return $this->_prenom;
	}
	
	public function setAdresse($text)
	{
		$this->_adresse = $text;
		return $this;
	}
	
	public function getAdresse()
	{
		return $this->_adresse;
	}
	
	public function setCp($text)
	{
		$this->_cp = $text;
		return $this;
	}
	
	public function getCp()
	{
		return $this->_cp;
	}
	
	public function setVille($text)
	{
		$this->_ville = $text;
		return $this;
	}
	
	public function getVille()
	{
		return $this->_ville;
	}
	
	public function setTelephone($text)
	{
		$this->_telephone = $text;
		return $this;
	}
	
	public function getTelephone()
	{
		return $this->_telephone;
	}
	
	public function setNote($text)
	{
		$this->_note = $text;
		return $this;
	}
	
	public function getNote()
	{
		return $this->_note;
	}
	
	public function setId($id)
	{
		$this->_id = (int) $id;
		return $this;
	}
	
	public function getId()
	{
		return $this->_id;
	}
	
	public function setMdp($_mdp) {
		$this->_mdp = $_mdp;
	}
	
	public function getMdp() {
		return $this->_mdp;
	}
	/**
	 * @return the $_salt
	 */
	public function getSalt() {
		return $this->_salt;
	}

	/**
	 * @param field_type $_salt
	 */
	public function setSalt($_salt) {
		$this->_salt = $_salt;
	}



}

